net stop MySQL
sc delete MySQL
SET dbhost=localhost
SET dbuser=root
SET dbpasswd=
SET dbName=
SET sqlpath=%~dp0
set MYSQL_HOME_TEMP=C:\mysql-8.0.21-winx64
set sqlfile=init.sql
setx /M "MYSQL_HOME" "C:\mysql-8.0.21-winx64"
setx /M "PATH" "%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%MYSQL_HOME_TEMP%\bin"
cd C:\mysql-8.0.21-winx64
cd c:
mysqld --initialize-insecure --user=mysql
mysqld -install
net start mysql
mysql -h%dbhost% -u%dbuser% -p%dbpasswd% < %sqlpath%%sqlfile% --default-character-set=utf8
net stop mysql
net start mysql
